---
layout: single
elementName: button
---

<section id="button" class="element">
  <header class="element-header">
    <nav class="element-links">
        <span>
          Type: <strong>inline</strong>
        </span>
      <span>
        Self-closing:
        <strong>
            No
        </strong>
      </span>
      <a class="element-links-direct" href="{{site.url}}/element/button/" data-element-name="button" data-tooltip="Single page for this element">Permalink</a>
      <a class="element-share" data-tooltip="Share on Twitter or Facebook" data-element-name="button">Share</a>
      <a target="_blank" href="https://developer.mozilla.org/en/docs/Web/HTML/Element/button" data-tooltip="See on Mozilla Developer Network" rel="external">MDN</a>
    </nav>
    <h2 class="element-name">
      <a href="#button">
        <span>#</span>
        button
      </a>
    </h2>
    <div class="element-description">
      <p>Defines a clickable <strong>button</strong>.</p>

    </div>
  </header>

      <div id="button-example-0" class="example">
        <p class="example-label">
          <strong>Example:</strong>
          <a class="example-clipboard" data-tooltip="Click to copy code" data-clipboard-target="#button-example-0-code">Copy</a>
        </p>
        <article class="example-preview">
            <div class="example-output"><button>
  Submit form
</button></div>
          <div id="button-example-0-code" class="example-code">{% highlight html %}<button>
  Submit form
</button>{% endhighlight %}</div>
        </article>
      </div>

    <article id="button-name" class="attribute">
      <header class="attribute-header">
        <h3 class="attribute-name">
          <code class="tag" data-tooltip="Click to copy" data-clipboard-text="name">
            name
          </code>
        </h3>
        <div class="attribute-description">
          <p>Defines the unique identifier for that button within the form. It allows the server to access each button&#39;s value when submitted.</p>

        </div>
      </header>

      <div class="attribute-values">
          <article id="button-name-submit_button" class="value">
            <header class="value-header">
                <h4 class="value-name">
                  <code class="tag" data-tooltip="Click to copy name=&quot;submit_button&quot;" data-clipboard-text="name=&quot;submit_button&quot;">
                      "submit_button"
                  </code>
                </h4>
              <div class="value-description">
                <p>The name value must be unique within the context of a <code>&lt;form&gt;</code> container.</p>
<p>It can only contain alphanumeric characters <code>a-z</code> <code>A-Z</code> <code>0-9</code> and some special characters like <code>-</code> <code>_</code>… but no space.</p>

              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><button  name="submit_button">Submit form</button></div>
            </aside>
          </article>
      </div>
    </article>
    <article id="button-value" class="attribute">
      <header class="attribute-header">
        <h3 class="attribute-name">
          <code class="tag" data-tooltip="Click to copy" data-clipboard-text="value">
            value
          </code>
        </h3>
        <div class="attribute-description">
          <p>The value sent to the server when submitting the form.</p>

        </div>
      </header>

      <div class="attribute-values">
          <article id="button-value-primary" class="value">
            <header class="value-header">
                <h4 class="value-name">
                  <code class="tag" data-tooltip="Click to copy value=&quot;primary&quot;" data-clipboard-text="value=&quot;primary&quot;">
                      "primary"
                  </code>
                </h4>
              <div class="value-description">
                <p>The server will receive the value <code>primary</code>.</p>

              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><button  value="primary">Submit form</button></div>
            </aside>
          </article>
      </div>
    </article>
    <article id="button-type" class="attribute">
      <header class="attribute-header">
        <h3 class="attribute-name">
          <code class="tag" data-tooltip="Click to copy" data-clipboard-text="type">
            type
          </code>
        </h3>
        <div class="attribute-description">
          <p>Defines the button type.</p>

        </div>
      </header>

      <div class="attribute-values">
          <article id="button-type-submit" class="value">
            <header class="value-header">
                <h4 class="value-name">
                  <code class="tag" data-tooltip="Click to copy type=&quot;submit&quot;" data-clipboard-text="type=&quot;submit&quot;">
                      "submit"
                  </code>
                </h4>
              <div class="value-description">
                <p>The button sends the form data to the server.</p>

              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><button  type="submit">Submit form</button></div>
            </aside>
          </article>
          <article id="button-type-reset" class="value">
            <header class="value-header">
                <h4 class="value-name">
                  <code class="tag" data-tooltip="Click to copy type=&quot;reset&quot;" data-clipboard-text="type=&quot;reset&quot;">
                      "reset"
                  </code>
                </h4>
              <div class="value-description">
                <p>The button resets the form.</p>

              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><button  type="reset">Reset</button></div>
            </aside>
          </article>
      </div>
    </article>
    <article id="button-disabled" class="attribute attribute--novalue">
      <header class="attribute-header">
        <h3 class="attribute-name">
          <code class="tag" data-tooltip="Click to copy" data-clipboard-text="disabled">
            disabled
          </code>
        </h3>
        <div class="attribute-description">
          <p>Disables the button.</p>

            <strong class="attribute-is-novalue">No value required.</strong>
        </div>
      </header>

      <div class="attribute-values">
          <article id="button-disabled-undefined" class="value">
            <header class="value-header">
              <div class="value-description">
                
              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><button  disabled>Submit form</button></div>
            </aside>
          </article>
      </div>
    </article>
    <article id="button-autofocus" class="attribute attribute--novalue">
      <header class="attribute-header">
        <h3 class="attribute-name">
          <code class="tag" data-tooltip="Click to copy" data-clipboard-text="autofocus">
            autofocus
          </code>
        </h3>
        <div class="attribute-description">
          <p>Sets focus on the element when the web page loads.</p>

            <strong class="attribute-is-novalue">No value required.</strong>
        </div>
      </header>

      <div class="attribute-values">
          <article id="button-autofocus-undefined" class="value">
            <header class="value-header">
              <div class="value-description">
                
              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><button >Submit form</button></div>
            </aside>
          </article>
      </div>
    </article>
</section>
